<template>
	<el-drawer title="物资申请审批详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form :model="form" ref="dialogForm" label-width="80px" label-position="left">
					<el-form-item label="申请标题">{{title}}</el-form-item>
					<el-form-item label="物资名称">{{suppliesName}}/{{brand}}/{{model}}</el-form-item>
					<el-form-item label="申请数量">{{quantity}}/{{unitName}}</el-form-item>
					<el-form-item label="使用人">{{usedUserName}}</el-form-item>
					<el-form-item label="申请说明">{{remark}}</el-form-item>
					<el-divider>审批结果</el-divider>
					<el-form-item label="审批数量">{{approvalQuantity}}
					</el-form-item>
					<el-form-item label="审批意见">
						<el-tag type="success" v-if="status=='1'">同意</el-tag>
						<el-tag type="info" v-else-if="status=='2'">不同意</el-tag>
						<el-tag type="warning" v-else>审批中</el-tag>
					</el-form-item>
					<el-form-item label="审批备注">{{approvalIdea}}</el-form-item>
					<el-form-item label="审批人">{{approvalUserName}}</el-form-item>
					<el-form-item label="审批时间">{{approvalTime}}</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	components: {
	},
	data() {
		return {
			loading: false,
			status:"",
			quantity:0,
			approvalQuantity:0,
			approvalUserName:"",
			approvalIdea:"",
			approvalTime:"",
			suppliesName:"",
			brand:"",
			unitName:"",
			model:"",
			usedUserName:"",
			remark:"",
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.status = data.status
			this.title = data.title
			this.brand = data.brand
			this.unitName = data.unitName
			this.quantity = data.quantity
			this.usedUserName = data.usedUserName
			this.approvalQuantity = data.approvalQuantity
			this.approvalIdea = data.approvalIdea
			this.approvalTime = data.approvalTime
			this.approvalUserName = data.approvalUserName
			this.suppliesName = data.suppliesName
			this.remark = data.remark
			this.model = data.model
		},
	}
}
</script>

<style>
</style>
